package cn.itcast.bos.service.take_delivery.impl;

import cn.itcast.domain.take_delivery.PromotionRepository;
import domain.take_delivery.Promotion;
import cn.itcast.bos.service.take_delivery.PromotionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class PromotionServiceImpl implements PromotionService {
    @Autowired
    private PromotionRepository promotionRepository;

    @Override
    public void save(Promotion model) {
     promotionRepository.save(model);
    }

    @Override
    public Page<Promotion> findPageDate(Pageable pageRequest) {
        return promotionRepository.findAll(pageRequest);
    }
}
